<!DOCTYPE html>
<html>
	{include file="public/header" /}
	<style type="text/css">
		.diyinput {
			height: 38px;
			line-height: 1.3;
			line-height: 38px;
			border-width: 1px;
			border-style: solid;
			background-color: #fff;
			border-radius: 2px;
			border-color: #f1eeee;
		}
	</style>

	<body>
		<div class="layui-fluid">
			<div class="layui-card">
				<div class="layui-card-body">
					<table id="LAY-user-manage" lay-filter="LAY-user-manage"></table>
				</div>
			</div>
		</div>

		{include file="public/footer" /}
		<script>
			layui.use(['index', 'table', 'laydate'], function() {
				var $ = layui.$,
					form = layui.form,
					table = layui.table,
					laydate = layui.laydate;

				laydate.render({
					elem: '#time1' //指定元素
				});
				laydate.render({
					elem: '#time2' //指定元素
				});
				table.render({
					elem: '#LAY-user-manage',
					even: true, //开启隔行背景
					url: "{:url('admin/orderhuankuan/zhanqi_list_ss')}?ID=" + "{$data.ID}",
					toolbar: '#test-table-toolbar-toolbarDemo',
					title: '用户数据表',
					cols: [
						[
							{
								type: 'numbers',
								title: '排序',
								width: 40,
								fixed: 'left',
								unresize: true,
							},
							{
								field: 'OrderSn',
								title: '订单编号',
								width: 180,
							},
							
							{
								field: 'Type',
								title: '还款类型',
								width: 100,
							},
							{
								field: 'pay',
								title: '支付方式',
								width: 100,
							},
							{
								field: 'LoanDay',
								title: '期限',
								width: 80,
							},
							{
								field: 'TotalMoney',
								title: '支付费用',
								width: 100,
							},
							
							{
								field: 'PayTime',
								title: '支付时间',
								width: 160,
							},
							{
								field: 'YyFkTime',
								title: '预约还款时间',
								width: 160,
							},
						]
					],
					page: true
				});

				//监听工具条
				table.on('tool(LAY-user-manage)', function(obj) {
					var data = obj.data;
					if(obj.event === 'detail') {
						layer.open({
							type: 2,
							title: '用户详情',
							content: 'detail.html?ID=' + data.ID,
							area: ['90%', '90%'],
							btn: ['确定', '取消'],
							
						});

					} 
				});
				//监听搜索
				form.on('submit(LAY-user-front-search)', function(data) {
					var field = data.field;

					//执行重载
					table.reload('LAY-user-manage', {
						where: field
					});
				});


				$('.layui-btn.layuiadmin-btn-useradmin').on('click', function() {
					var type = $(this).data('type');
					active[type] ? active[type].call(this) : '';
				});
			});
		</script>
	</body>

</html>